package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.impl.ShopServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ShopController {

    @Autowired
    private ShopServiceImpl shopService;

    @GetMapping("/admin/shop/status")
    public Result getStatus() {
        Integer status = shopService.getStatus();
        return Result.success(status);
    }

    @PutMapping("/admin/shop/{status}")
    public Result updateStatus(@PathVariable Integer status) {
        Integer result = shopService.updateStatus(status);
        return Result.success(result);
    }
}
